<template>
  <div class="edit-dialog">
    <el-dialog
      title="在线预审"
      :visible.sync="onlineShow"
      width="1245px"
      :before-close="handleClose"
      :close-on-click-modal="false"
      custom-class="dialog-box"
    >
      <el-table :data="tableData" border v-loading="loading">
        <el-table-column
          label="序号"
          type="index"
          width="65"
          align="center"
        ></el-table-column>
        <el-table-column
          label="专家姓名"
          align="center"
          prop="expertName"
          width="296"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column label="状态" align="center" prop="status" width="113">
          <template slot-scope="scope">
            <span class="icon-state icon-blue" v-show="scope.row.status == '2'"
              ><span></span
            ></span>
            <span class="icon-state icon-red" v-show="scope.row.status === '15'"
              ><span></span
            ></span>
            <span
              class="icon-state icon-green"
              v-show="scope.row.status === '已审批'"
              ><span></span
            ></span>
            <span
              class="icon-state icon-orange"
              v-show="scope.row.status === '未审批'"
              ><span></span
            ></span>
            <span>{{ scope.row.status }}</span>
          </template>
        </el-table-column>
        <el-table-column label="批复附件" align="center" prop="approvalDatabaseFile.fileName" width="249">
          <template slot-scope="scope">
            <a :href="scope.row.approvalDatabaseFile?scope.row.approvalDatabaseFile.fileUrl:''" style="color:#3171ee">
              {{scope.row.approvalDatabaseFile?scope.row.approvalDatabaseFile.fileName:''}}
            </a>
          </template>
        </el-table-column>        
        <el-table-column
          label="预审结果"
          align="center"
          prop="approvalResult"
          width="249"
        />
        <el-table-column
          label="预审意见"
          align="center"
          prop="approvalOpinion"
          show-overflow-tooltip
        />
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">关 闭</el-button>
        <!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { getOnLinePreliminary } from "@/api/manage/manage";
export default {
  name: "onlineDialog",
  props: {
    onlineShow: {
      type: Boolean,
      default: "",
    },
    type: {
      type: String,
      default: "",
    },
    proid: {
      type: String,
      default: "",
    },
    timeData: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      // 遮罩层
      loading:false,
      rules: {},
      ruleForm: {},
      tableData: [],
    };
  },
  watch: {
    onlineShow(val) {
      this.loading = true;
      if (val) {
        getOnLinePreliminary({
          proId: this.proid,
          createTime: this.timeData,
        }).then((res) => {
          if (res) {
            this.loading = false
            this.tableData = res;
          }
        });
      }
    },
  },
  created() {},
  methods: {
    /** 取消按钮 */
    handleClose() {
      this.$emit("changeShowDialog", "false"); //调用父组件的自定义事件，并传值
    },
    /** 确定按钮 */
    submitForm() {
      this.$emit("changeShowDialog", "false");
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(
        `当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${
          files.length + fileList.length
        } 个文件`
      );
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
  },
};
</script>

<style lang="scss">
</style>
